<?php
namespace app\common\validate;

use think\Validate;

class UserMateValidate extends Validate
{
    protected $rule =   [
        'id'                               => 'require|integer',
        'user_id|用户ID'                   => 'require|integer',
        'sex|性别'                         => 'require|in:1,2',
        'age|年龄段'                       => 'require|length:1,20',
        'height|身高范围'                  => 'require|length:1,20',
        'weight|体重范围'                  => 'require|length:1,20',
        'edu_status|学历'                  => 'require|length:1,50',
        'address_home|家乡'                => 'require|length:1,100',
        'address_seat|所在地'              => 'require|length:1,100',
        'marry_status|婚姻状态'            => 'require|integer',
        'children_status|子女'             => 'length:0,50',
        'is_birth|婚后是否需要生育'         => 'in:1,0',
        'is_old_live|婚后是否与老人同住'    => 'in:1,0',
        'income|收入水平'                  => 'require|length:1,50',
        'room_status|住房情况'             => 'require|length:1,50',
        'travel_status|出行工具'           => 'require|length:1,50',
    ];
    
    protected $scene = [
        'add'   => ['user_id', 'sex', 'age', 'height', 'weight', 'edu_status', 'address_home', 'address_seat', 'marry_status', 'children_status', 'is_birth', 'is_old_live', 'income', 'room_status', 'travel_status'],
    ];
}